/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package clinicapoo.model;

import clinicapoo.factory.Services;
import java.io.Serializable;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;

/**
 *
 * @author Fabio Montezuma
 */
@Entity
public class Paciente implements Serializable {

    private Integer id;
    private String cpf;
    private String nome;

    private String address;
   
    private String telefone;
    private String celular;
    
    private Set<Consulta> consultas;

    @Id
    @GeneratedValue
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCpf() {
        return cpf;
    }

    public void setCpf(String cpf) {
        this.cpf = cpf;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public String getTelefone() {
        return telefone;
    }

    public void setTelefone(String telefone) {
        this.telefone = telefone;
    }

    public String getCelular() {
        return celular;
    }

    public void setCelular(String celular) {
        this.celular = celular;
    }


    public String getAddress() {
        return address;
    }

    @OneToMany(cascade = CascadeType.ALL, mappedBy = "paciente")
    public Set<Consulta> getConsultas() {
        return consultas;
    }
    public void setAddress(String address) {
        this.address = address;
    }

    public void setConsultas(Set<Consulta> consultas) {
        this.consultas = consultas;
    }
    @Override
    public String toString() {
        return Services.serializador.serializar(this);
    }

}
